@echo off

for /f "tokens=5-7" %%a in ('Bcdedit /copy {memdiag} /d "Boot Application Test"') do set guid1=%%c

set guid=%guid1:~0,-1%

bcdedit /toolsdisplayorder %guid% /addlast
bcdedit /set %guid% path \boot\bootapp.exe

makecert -r -pe -ss TestStore -n "CN=Test" Test.csr
certmgr /add Test.csr /s /r localMachine root